require('./Dgzsmx.less');
import React from 'react';
import { Button,Page, Panel,PanelHeader, PanelBody, PanelFooter,ButtonArea,
  MediaBox,Cells, Cell,CellHeader,MediaBoxTitle,MediaBoxHeader,
  MediaBoxDescription,MediaBoxBody,MediaBoxInfo,MediaBoxInfoMeta,PullToRefresh,
  CellBody,CellFooter,Toast, Form,FormCell,Radio,Gallery,GalleryDelete,
  Uploader,TextArea,ActionSheet,Flex,FlexItem,SearchBar} from  'react-weui/build/packages'
import {Control} from 'react-keeper';
import yuanlinlvhua  from './../../assets/img/园林绿化.png';
import ludeng  from './../../assets/img/路灯.png';
import jingguandeng  from './../../assets/img/景观灯.png';
import anquanwenming  from './../../assets/img/安全文明施工.png';
import 'weui';
import 'react-weui/build/packages/react-weui.css';

class Dgzsmx extends React.Component {
  constructor(props) {
    super(props);

  }

  render() {
    const { item , suggesttype  } = this.props;

    return (
      <Panel>
        <PanelHeader>
          {suggesttype == 1 ? "路灯" :
            suggesttype == 2 ? "景观灯" :
              suggesttype == 3 ? "安全文明施工" :
                suggesttype == 4 ? "园林绿化" : ""}
        </PanelHeader>
        <PanelBody>
          <MediaBox type="appmsg" onClick={(e) =>{
                 if(item){
                        {Control.go('/dgzshome/edit',
                          {dataDetail:item
                          })}}}}><MediaBoxHeader>
            {item && item.urlList.length > 0 ? <img src={item.urlList[0]}/> : <img src={suggesttype==1?ludeng:
                            suggesttype==2?jingguandeng:
                              suggesttype==3?anquanwenming:
                                suggesttype==4?yuanlinlvhua:''}/>}
          </MediaBoxHeader>
            <MediaBoxBody>
              <MediaBoxTitle>{item ? item.title : '暂无数据'}
              </MediaBoxTitle>
              <MediaBoxDescription>
                {item ? item.viewdesc : ''}
              </MediaBoxDescription>
              {item &&
              <MediaBoxInfo>
                <MediaBoxInfoMeta extra className="zt-color">{item.tjrNick}</MediaBoxInfoMeta>
                <MediaBoxInfoMeta>{item.createdTime}</MediaBoxInfoMeta>

              </MediaBoxInfo>
              }
            </MediaBoxBody> </MediaBox>
        </PanelBody>
        <PanelFooter onClick={() =>{Control.go("/dgzshome/list",{type:suggesttype})}}>
          <Cell access link>
            <CellBody></CellBody>
            <CellFooter>查看更多</CellFooter>
          </Cell>
        </PanelFooter>
      </Panel>
    );
  }
}

export default Dgzsmx ;
